package search.lucene;

import org.apache.lucene.analysis.TokenStream;
import org.wltea.analyzer.lucene.IKAnalyzer;

import java.io.IOException;

/**分词器IK*/
public class IKDemo {

    public static void main(String[] args) throws IOException {
        IKAnalyzer analyzer = new IKAnalyzer();
        TokenStream stream = analyzer.tokenStream("name", "慈祥世界和平");
        stream.reset();
        while (stream.incrementToken()) {
            System.out.println("分词结果:" + stream.reflectAsString(false));
        }
    }
}
